import java.util.Scanner;
class ATM{
	public static void main(String[] args){
		double banlance = 0;
		boolean num = true;
		Scanner sc = new Scanner(System.in);
		while (num){
			System.out.println("======ATM======");
			System.out.println("1.存款");
			System.out.println("2.取款");
			System.out.println("3.显示金额");
			System.out.println("4.退出");
			System.out.println("请选择（1-4）：");
			int num01 = sc.nextInt();
			if (num01 == 1){
				System.out.println("请输入存款金额");
				double price = sc.nextInt();
				banlance = banlance + price;
			}else if (num01 == 2){
				System.out.println("请输入取款金额");
				double price01 = sc.nextInt();
				if (price01 > banlance){
					System.out.println("金额不足");
				}else if (price01 <= 0){
					System.out.println("请输入正确金额");
				}else{
					banlance = banlance - price01;
				}
			}else if (num01 == 3){
				System.out.println("金额为====>"+banlance);
			}else if (num01 == 4){
				num = false;
			}else{
				System.out.println("请选择正确的数字");
			}
		}
	}
}